package com.bbzn.device.client.service.impl;

import com.bbzn.device.client.dao.vcrinfo.VcrInfoMapper;
import com.bbzn.device.client.dataobject.VcrInfo;
import com.bbzn.device.client.dto.vcr.VcrInfoDTO;
import com.bbzn.device.client.service.VcrInfoService;
import com.bbzn.device.client.utils.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class VcrInfoServiceImpl implements VcrInfoService {

    @Resource
    private VcrInfoMapper vcrInfoMapper;

    @Override
    public int deleteByPrimaryKey(Long id) {
        return vcrInfoMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(VcrInfo record) {
        return vcrInfoMapper.insert(record);
    }

    @Override
    public int insertOrUpdate(VcrInfo record) {
        return vcrInfoMapper.insertOrUpdate(record);
    }

    @Override
    public int insertOrUpdateSelective(VcrInfo record) {
        return vcrInfoMapper.insertOrUpdateSelective(record);
    }

    @Override
    public int insertSelective(VcrInfo record) {
        return vcrInfoMapper.insertSelective(record);
    }

    @Override
    public VcrInfo selectByPrimaryKey(Long id) {
        return vcrInfoMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(VcrInfo record) {
        return vcrInfoMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(VcrInfo record) {
        return vcrInfoMapper.updateByPrimaryKey(record);
    }

    @Override
    public List<VcrInfo> selectByAll(VcrInfoDTO vcrInfo) {
        return vcrInfoMapper.selectByAll(vcrInfo);
    }

    @Override
    public int updateBatch(List<VcrInfo> list) {
        return vcrInfoMapper.updateBatch(list);
    }

    @Override
    public int updateBatchSelective(List<VcrInfo> list) {
        return vcrInfoMapper.updateBatchSelective(list);
    }

    @Override
    public int batchInsert(List<VcrInfo> list) {
        return vcrInfoMapper.batchInsert(list);
    }

    @Override
    public PageInfo<VcrInfo> selectByPage(VcrInfoDTO record) {
        PageInfo<VcrInfo> pageInfo = new PageInfo<>();
        pageInfo.setPageNum(record.getPageNum());
        pageInfo.setPageSize(record.getPageSize());
        pageInfo.setResultList(vcrInfoMapper.selectByPage(record));
        int count = vcrInfoMapper.selectCount(record);
        pageInfo.setTotalRecord(count);
        return pageInfo;
    }

    @Override
    public List<VcrInfo> findByAll(VcrInfo vcrInfo) {
        return vcrInfoMapper.findByAll(vcrInfo);
    }

    @Override
    public List<VcrInfo> selectByImei(String imei) {
        return vcrInfoMapper.selectByImei(imei);
    }
}


